package com.mzpai.api;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;

@Configuration
@SpringBootApplication
@EnableConfigurationProperties
@ComponentScan(basePackages = {"com.mzpai"})
@ImportResource("classpath:applicationContext-mybatis.xml")
public class Application extends SpringBootServletInitializer {

	 protected static Logger logger = LoggerFactory.getLogger(Application.class);
	 
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
        logger.info("mzpai-product-web 启动成功");
        
    }

    
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        // 注意这里要指向原先用main方法执行的Application启动类  war包支持
        return builder.sources(this.getClass());
    }
    
    
}